﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    public class Solution7
    {
        public bool IsAnagram(string s, string t)
        {
            if (s.Length!=t.Length)
            {
                return false;
            }
            char[] ss = s.ToCharArray();
            char[] tt = t.ToCharArray();
            Array.Sort(ss);
            Array.Sort(tt);
            for (int i = 0; i < ss.Length; i++)
            {
                if (ss[i] != tt[i])
                {
                    return false;
                }
            }
            return true;
        }
    }
}
